home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / sdkdigv8.zip / SDKV8N18.TXT < prev    next >
Text File  |  1994-01-20  |  7KB  |  176 lines

  1. Apparently-To: john.smith@gravis.com
  2.  
  3.  
  4. GUS Programmer's Digest     Thu, 20 Jan 94  4:06         Volume 8: Issue  18  
  5.  
  6. Today's Topics:
  7.                               Envelopes
  8.                 Scaling Frequency for correct note ...
  9.                     Sources on Programmers Digest
  10.  
  11. Standard Info:
  12.     - Meta-info about the GUS can be found at the end of the Digest.
  13.     - Before you ask a question, please READ THE FAQ.
  14.  
  15. ----------------------------------------------------------------------
  16.  
  17. Date: Wed, 19 Jan 1994 20:32:32 -0500 (EST)
  18. From: Phat H Tran <ptran@sciborg.uwaterloo.ca>
  19. Subject: Envelopes
  20.  
  21. > Date: Tue, 18 Jan 1994 12:13:40 -0600 (CST)
  22. > From: Jason William Whiteman <jww9624@tamsun.tamu.edu>
  23. > Subject: Envelope offsets
  24. > > > I am taking the envelope offset values to be an addative value (always
  25. > > > with respect to the initial volume) unless the envelope offset is 
  26. > > > below a threshold point.  Because you cannot add any positive value
  27. > > 
  28. > > I'm not quite clear on what you're getting at.  The offset is absolute,
  29. > > not additive, as far as I'm aware.
  30. >     If envelope values are absolute volumes for the patch, then you
  31. > could never set the volume of the patch playing softer or louder.  If they
  32. > were absolute volumes, then the volume would always be set at whatever
  33. > the envelope values say.. However, we can both agree that the OVERALL
  34.  
  35. The envelope offsets are absolute when taken in isolation.  I was 
  36. under the impression that we were discussing the envelope for one voice
  37. unattenuated by factors such as channel volume and expression, and thus
  38. couldn't make heads or tails of why you'd treat the offsets as additive.
  39.  
  40. > volume (disregarding the envelope) can be increased or decreased.  
  41. > Superimposed over this OVERALL volume are the volumes of the individual
  42. > envelope offsets.
  43.  
  44. Since the GUS' volume is log instead of linear, with a zero volume setting
  45. of zero and not negative infinity, I'm not sure how we'd go about attenuating
  46. the envelope offsets.  Do we substract some x from the offsets based on the
  47. channel volume?  I think this would be the way it's done for a true log scale
  48. (i.e. one that goes to negative infinity for zero volume).  For the GUS,
  49. it's probably best to treat everything linearly, and just use the following
  50. formula:
  51.  
  52.   linoffset = chan_vol/127 * expression/127 * absoffset
  53.   logoffset = log(linoffset + 1)/log(128) * K
  54.  
  55. Logoffset would be the value we'd poke into the GUS' voice volumes and 
  56. ramp points.
  57.  
  58. Disclaimer:  The above was typed in with hurried thought.  Correcting
  59. my mistakes is left as an exercise for the reader. :)
  60.  
  61. Phat.
  62.  
  63. ------------------------------
  64.  
  65. Date: Wed, 19 Jan 94 09:53:50 EST
  66. From: support@fortech.com (Technical Support)
  67. Subject: Scaling Frequency for correct note ...
  68.  
  69. Hello,
  70.  
  71. > frequency for the GUS to play the patch at.  What I would now like to know is 
  72. > how to scale the frequnecy to play say a G4 when the original sound was 
  73. > recorded at C4.  Surely, the root freq and may be the sampling freq have to 
  74. > taken into consideration.  Do I work it out by multiplying ( or dividing, 
  75. > which ever the case may be) the root freq by the twelfth root of two ( 
  76. > 1.0594..) and working out the freq that way?
  77.  
  78.  
  79. First, lets explain a couple of terms for those who don't know what they
  80. are.
  81.  
  82. Root Frequency - Frequency of the thing recorded.
  83. Sample Frequency - Sample Rate at which the root frequency (or tone) was
  84.                    recorded.
  85.  
  86. Example:
  87. a 1Khz tone recorded at 44.1khz would have a root freq of 1Khz and
  88. a sample frequency of 44.1khz
  89.  
  90.  
  91. First, calculate the sample ratio. There is a sample ratio for EACH
  92. wave sample in a patch (up to 16). This must be scaled by the frequency
  93. divisor for the # of active voices (This table is in SDK,vocfreq.c). 
  94. Adding in 1/2 the sample rate (sample>>1) is to allow for rounding. 
  95. This calulation can be done at patch load time and saved on a per-wave 
  96. basis since this will not change (unless # active voices change .... )
  97.  
  98. sample_ratio = ((ULONG)
  99.         (freq_divisor[active_voices-14]) * 512L +
  100.         (ULONG )(sample_rate>>1)) /
  101.         (ULONG )sample_rate;
  102.  
  103. Now when you are ready to do a note on, calulate the FC based on the
  104. pre-calculated sample ratio, root freq and desired playback frequency.
  105.  
  106. USHORT Calculate_FC(unsigned int sample_ratio, long root, long frequency)
  107. {
  108.     ULONG freq_register;
  109.  
  110.     freq_register  = (((ULONG)frequency * 512L) +
  111.              (ULONG)(root>>1)) /
  112.              (ULONG)root;
  113.     freq_register  = ((ULONG)freq_register * 512L +
  114.                (ULONG)(sample_ratio>>1)) / 
  115.                sample_ratio ;
  116.     return((USHORT)freq_register);
  117. }
  118.  
  119. Make sure you use large enough variables (ULONG) since some of the
  120. the intermediate values get VERY large.
  121.  
  122. Hope this helps.
  123.  
  124. Forte Tech Support
  125.  
  126. ------------------------------
  127.  
  128. Date: Thu, 20 Jan 94 09:52:51 GMT
  129. From: Flynn Peter R BSc 1 Mod Comp 93-94 <P.Flynn@teesside.ac.uk>
  130. Subject: Sources on Programmers Digest
  131.  
  132. I thought the programmers digest would be a clinic for ailing programmers. 
  133.  
  134. It would be nice if example sources were placed often.  
  135.  
  136. The Gravis Developers Kit is OK but examples in C aren't really that good
  137. to me as I am reaching all the hardware from PM386 Assembler.
  138.  
  139. I really need a better source site than ftp.uwp.edu
  140.  
  141. Speech recognition on the GUS is a problem.  Not that the GUS can't do
  142. it but because of the amount of space used to store recognition data.
  143.  
  144. A multi-user recognition package would go down a treat but until then we are
  145. limited by the systems we are using.
  146.  
  147. Hmm :-(
  148.  
  149. Peter Flynn
  150. SHADE    
  151.  
  152. ------------------------------
  153.  
  154. End of GUS Programmer's Digest V8 #18
  155. *************************************
  156.  
  157. To post to tomorrow's digest:                    <gus-sdk@dsd.es.com>
  158. To (un)subscribe or get help:            <gus-sdk-request@dsd.es.com>
  159. To contact a human (last resort):          <gus-sdk-owner@dsd.es.com>
  160.  
  161. FTP sites:           archive.epas.utoronto.ca              /pub/pc/ultrasound
  162.                      wuarchive.wustl.edu            /systems/ibmpc/ultrasound
  163.                      archive.orst.edu                    /pub/packages/gravis
  164.                      theoris.rz.uni-konstanz.de                /pub/sound/gus
  165.                      nctuccca.edu.tw                           /PC/ultrasound
  166. FTP mail server:     mail-server@nike.rz.uni-konstanz.de
  167.  
  168. Hints:
  169.       - Get the FAQ from the FTP sites or the request server.
  170.       - Mail to <gus-sdk-request@dsd.es.com> for info about other GUS
  171.     related mailing lists (general use, musician's, etc.).
  172.  
  173.  
  174.